| 12345678910111213141516171819202122232425 |
- import { NextResponse } from "next/server";
- import { loadAgentFeed } from "@/lib/agent-monitor";
- type AgentRouteProps = {
- params: Promise<{
- agentId: string;
- }>;
- };
- export async function GET(_: Request, { params }: AgentRouteProps) {
- const { agentId } = await params;
- const feed = await loadAgentFeed("all");
- const agent = feed.agents.find((item) => item.id === agentId);
- if (!agent) {
- return NextResponse.json({ message: "Agent not found" }, { status: 404 });
- }
- return NextResponse.json({
- source: feed.source,
- sourceLabel: feed.sourceLabel,
- fetchedAt: feed.fetchedAt,
- agent
- });
- }
|